﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RuleCode.Table;

namespace ERPWebDemos.Forms.SingleTable
{
    public partial class SingleTableList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //    RuleCode.Table.Users u = new RuleCode.Table.Users();
            //    RuleQueryTable1.SetQueryTable(u, "");
            //    RuleQueryTable1.PageSize = 20;
            //}
        }
        protected override void OnPreRender(EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //    bind(0);
            //}
        }

        private void bind(Int32 _pageindex)
        {

            //RuleQueryTable1.run(_pageindex);
            //WebPager1.DT = RuleQueryTable1.DT;
            //WebPager1.DataBind();
            
        }

        protected void WebPager1_PageIndexChanged(object sender, RuleCode.Controls.PageChangedEventArgs e)
        {
            WebPager1.CurrentPageIndex = e.NewPageIndex;
            bind(e.NewPageIndex);
        }


        protected void RuleQueryTable1_ButtonClick(object sender, EventArgs e)
        {
            bind(0);
        }
        
    }
}
